<?php

/**
 * Teaching form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseTeachingForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'teacher_id'          => new sfWidgetFormPropelChoice(array('model' => 'Teacher', 'add_empty' => false)),
      'class_id'            => new sfWidgetFormPropelChoice(array('model' => 'Classes', 'add_empty' => false)),
      'teaching_status'     => new sfWidgetFormInput(),
      'teaching_start_time' => new sfWidgetFormDateTime(),
      'teaching_end_time'   => new sfWidgetFormDateTime(),
      'teaching_count'      => new sfWidgetFormInput(),
      'Note'                => new sfWidgetFormTextarea(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorPropelChoice(array('model' => 'Teaching', 'column' => 'id', 'required' => false)),
      'teacher_id'          => new sfValidatorPropelChoice(array('model' => 'Teacher', 'column' => 'id')),
      'class_id'            => new sfValidatorPropelChoice(array('model' => 'Classes', 'column' => 'id')),
      'teaching_status'     => new sfValidatorInteger(),
      'teaching_start_time' => new sfValidatorDateTime(),
      'teaching_end_time'   => new sfValidatorDateTime(),
      'teaching_count'      => new sfValidatorInteger(array('required' => false)),
      'Note'                => new sfValidatorString(array('required' => false)),
      'created_at'          => new sfValidatorDateTime(array('required' => false)),
      'updated_at'          => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('teaching[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Teaching';
  }


}
